﻿Public Class Form255
    Dim rs As OleDb.OleDbDataReader, report As ReportExcel.clsReport
    Dim strPath As String

    Private Sub Form255_Activated(sender As Object, e As EventArgs) Handles Me.Activated
        'Me.setPhanQuyen(Me.BH_BanHangTableAdapter.getQuyen_TaoMoi(UserId, Me.Tag), Me.BH_BanHangTableAdapter.getQuyen_Sua(UserId, Me.Tag), Me.BH_BanHangTableAdapter.getQuyen_Xoa(UserId, Me.Tag), GetPhanQuyenManHinh_FormDoi_ChiTiet_DanhSachTableAdapter.GetData(Me.Tag))
    End Sub
    Private Sub Form255_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PCV_GDPDataSet.DM_KhachHang' table. You can move, or remove it, as needed.
        Me.DM_KhachHangTableAdapter.Fill(Me.PCV_GDPDataSet.DM_KhachHang)
        'TODO: This line of code loads data into the 'PCV_GDPDataSet.BH_BanHangThue' table. You can move, or remove it, as needed.
        Me.BH_BanHangThueTableAdapter.Fill(Me.PCV_GDPDataSet.BH_BanHangThue)
        'TODO: This line of code loads data into the 'PCV_GDPDataSet.BH_BanHangChiTiet' table. You can move, or remove it, as needed.
        Me.BH_BanHangChiTietTableAdapter.Fill(Me.PCV_GDPDataSet.BH_BanHangChiTiet)
        'TODO: This line of code loads data into the 'PCV_GDPDataSet.BH_BanHang' table. You can move, or remove it, as needed.
        Me.BH_BanHangTableAdapter.Fill(Me.PCV_GDPDataSet.BH_BanHang)
        ''TODO: This line of code loads data into the 'PCV_CLINICDataSet.DMKhoa' table. You can move, or remove it, as needed.
        'Me.DMKhoaTableAdapter.Fill(Me.PCV_CLINICDataSet.DMKhoa)
        ''TODO: This line of code loads data into the 'PCV_CLINICDataSet.DMIcd' table. You can move, or remove it, as needed.
        'Me.DMIcdTableAdapter.Fill(Me.PCV_CLINICDataSet.DMIcd)
        'strPath = System.AppDomain.CurrentDomain.BaseDirectory()
        'Me.OleDbConnection1.Open()
        'Me.OleDbCommand1.Parameters(0).Value = 5
        'rs = OleDbCommand1.ExecuteReader
        ''tao bao cao
        'report = New ReportExcel.clsReport(rs, strPath & "reports\template\rpt_ListOfProducts1.xls", strPath & "reports\rpt_ListOfProducts1" & Today.Day & Today.Month & Today.Year & Today.Hour & Today.Minute & Today.Second & ".xls")
        'report.SetParameter1("$nguoinopthue", "nguoinopthue")
        'report.SetParameter1("$masothue", "masothue")
        'report.fillDataToExcel()
        ''dong ket noi
        'rs.Close()
        'rs = Nothing
        'OleDbConnection1.Close()
        ''mở report
        'report.OpenReport()
        'report = Nothing
        ' Me.setPhanQuyen(True, True, True, GetPhanQuyenManHinh_FormDoi_ChiTiet_DanhSachTableAdapter.GetData(Me.Tag))
    End Sub

    Public Sub New()
        Me.IGridViewDsThamChieu1.setColumnCheck()
        'Me.IGridViewDsThamChieu2.setColumnCheck()
        InitializeComponent()
        Me.setSoTabThamChieu(3)
        Me.setSoTab(2)
        Me.setObj(Me.PCV_GDPDataSet, Me.PCV_GDPDataSet.BH_BanHang, Me.BH_BanHangBindingSource, Me.TableAdapterManager, Me.BH_BanHangTableAdapter, Me.ManghiepvuITextEdit, Me.SochungtuITextEdit)
        Me.setTab1(Me.PCV_GDPDataSet.BH_BanHangChiTiet, Me.FKBHBanHangChma793DFFAFBindingSource, Me.BH_BanHangChiTietTableAdapter)
        Me.setColumnsChangeTab1(New ArrayList From {"soluonggiao", "dongiavnd", "tilethuegtgt", "tienthuegtgt"})
        Me.setColumnValueTab1(Me.colEx1ChiTiet01, Me.colthanhtienvnd)
        Me.setColumnValueTab1(Me.colEx2ChiTiet01, Me.coltienthuegtgt)
        Me.IGridViewChiTiet01.setBatLoi("madonviuid", "not null")
        Me.IGridViewChiTiet01.setBatLoi("soluonggiao", "not 0 and not null")
        Me.IGridViewChiTiet01.setBatLoi("giaban", "not 0 and not null")
    End Sub
    Private Sub BarButtonItemLamTuoi_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemLamTuoi.ItemClick
        Dim ht As Hashtable = New Hashtable
        ht.Add("ma", "ma")
        ht.Add("ma", "ten")
        setGridtoGrid(Me.IGridViewDs01, IGridViewChiTiet01, ht, "ma", "ma")
    End Sub

    Private Sub IGridViewChiTiet01_InitNewRow(sender As Object, e As DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs) Handles IGridViewChiTiet01.InitNewRow
        Me.IGridViewChiTiet01.SetFocusedRowCellValue("uid", System.Guid.NewGuid)
        Me.IGridViewChiTiet01.SetFocusedRowCellValue("tygia", 10)
        Me.IGridViewChiTiet01.SetFocusedRowCellValue("nguyente", 0)
        Me.IGridViewChiTiet01.SetFocusedRowCellValue("tienvnd", 0)
    End Sub
    Public Overrides Sub setSubSau_TaoMoi()
        Me.setMacDinhCotAn("ma", Guid.NewGuid.ToString)
    End Sub
 
End Class
